<html>
<head>
<title>AND/OR/NAND/NOR Gate</title>
</head>

<body bgcolor="FFFFFF">

<table><tr><td>
<img align="center" height="32" width="32" src="../../icons/andGate.gif" />
<img align="center" height="32" width="32" src="../../icons/orGate.gif" />
<img align="center" height="32" width="32" src="../../icons/nandGate.gif" />
<img align="center" height="32" width="32" src="../../icons/norGate.gif" /><br />
<img align="center" height="32" width="32" src="../../icons/andGateRect.gif" />
<img align="center" height="32" width="32" src="../../icons/orGateRect.gif" />
<img align="center" height="32" width="32" src="../../icons/nandGateRect.gif" />
<img align="center" height="32" width="32" src="../../icons/norGateRect.gif" />
</td><td valign="center"><h1><em>AND/OR/NAND/NOR Gate</em></h1></table>

<p><table>
<tr><td><strong>Library:</strong></td>
	<td><a href="index.html">Base</a></td></tr>
<tr><td><strong>Introduced:</strong></td>
	<td>2.0 Beta 1</td></tr>
<tr><td valign="top"><strong>Appearance:</strong></td>
	<td valign="top"><img src="../images/basic.png" /></td></tr>
</table></p>

<h2>Behavior</h2>

<p>The AND, OR, NAND, and NOT gates each compute the respective
function of the inputs, and emit the result on the output.
The two-input truth table for the gates is the following.</p>
<center><table>
<tr><th><var>x</var></th><th><var>y</var></th><th>AND</th>
<th>OR</th><th>NAND</th><th>NOR</th></tr>
<tr><td align="center">0</td><td align="center">0</td>
  <td align="center">0</td><td align="center">0</td>
  <td align="center">1</td><td align="center">1</td></tr>
<tr><td align="center">0</td><td align="center">1</td>
  <td align="center">0</td><td align="center">1</td>
  <td align="center">1</td><td align="center">0</td></tr>
<tr><td align="center">1</td><td align="center">0</td>
  <td align="center">0</td><td align="center">1</td>
  <td align="center">1</td><td align="center">0</td></tr>
<tr><td align="center">1</td><td align="center">1</td>
  <td align="center">1</td><td align="center">1</td>
  <td align="center">0</td><td align="center">0</td></tr>
</table></center>
<p>Normally, any inputs that are unspecified (i.e., floating) are ignored;
the AND and OR gates compute the AND/OR of all specified inputs, and the
NAND/NOR gates compute the complement of the AND/OR of all specified
inputs. And if all
inputs are floating, then the output is floating, too.
If, however, the "Gate Output When Undefined" option is "Error for
undefined inputs," then the output will be the error value if one or more of
the inputs are floating.</p>

<p>If any of the
inputs are the error value (e.g., if conflicting values are coming into
the same wire), then the output will be the error value, too.</p>

<p>The multi-bit versions of each gate will perform its one-bit
transformation bitwise on its inputs.</p>

<h2>Pins</h2>

<dl>

<dt>West edge (inputs, bit width according to Bit Width attribute)</dt>
<dd><p>The inputs into the component. There will be as many of these as
specified in the Number of Inputs attribute.</p>

<p>Note that if you are using shaped gates, the west side of OR and NOR
gates will be curved. Nonetheless, the input pins are in a line. Logisim
will draw short stubs illustrating this; and if you overshoot a stub, it
will silently assume that you did not mean to overshoot it. In "printer
view", these stubs will not be drawn unless they are connected to
wires.</p></dd>

<dt>East edge (output, bit width according to Bit Width attribute)</dt>
<dd><p>The gate's output, whose value is computed based on the current
inputs as described above.</p></dd>

</dl>

<h2>Attributes</h2>

<dl>

<dt>Facing</dt>
<dd>The direction of the component (its output relative to its inputs).</dd>

<dt>Data Bits</dt>
<dd>The bit width of the component's inputs and outputs.</dd>

<dt>Gate Size</dt>
<dd>Determines whether to draw a wider or narrower version of the
component. This does not affect the number of inputs, which is specified
by the Number of Inputs attribute; however, if the number of inputs
exceeds 3 (for a narrow component) or 5 (for a wide component), then the
gate will be drawn with "wings" to be able to accommodate the number of
inputs requested.</dd>

<dt>Number of Inputs</dt>
<dd>Determines how many pins to have for the component on its west
side.</dd>

</dl>

<h2>Poke Tool Behavior</h2>

<p>None.</p>

<h2>Text Tool Behavior</h2>

<p>None.</p>

<p><a href="../index.html">Back to <em>Library Reference</em></a></p>

</body>
</html>
